package concurrency;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import junit.framework.TestCase;

/**
 * 休眠
 *
 * 2018年 09月 16日 星期日
 * fireway
 */
public class SleepingTaskTestCase extends TestCase {
    public void test() {
        ExecutorService exec = Executors.newCachedThreadPool();
        for (int i = 0; i < 5; i++) {
            exec.execute(new SleepingTask());
        }
        exec.shutdown();
        System.out.print("Waiting for LiftOff! ");
    }
}
